<?php
global $_GPC, $_W;

$GLOBALS['frames'] = $this->getMainMenu2();

$info=pdo_get('zhtc_video_card',array('id'=>$_GPC['id']));



//var_dump($info);die;

if(checksubmit('submit')){
     	
        $data['title']=$_GPC['title'];
        $data['city_id']=$_COOKIE['account_id'];
         $data['uniacid']=$_W['uniacid'];
        $data['content']=html_entity_decode($_GPC['content']);
        $data['addtime']=date('Y-m-d H:i:s');
        
     if($_GPC['id']==''){  
       
       
        $res=pdo_insert('zhtc_video_card',$data);
        if($res){
             message('添加成功！', $this->createWebUrl('videocardlist'), 'success');
        }else{
             message('添加失败！','','error');
        }
    }else{
     
        $res=pdo_update('zhtc_video_card',$data,array('id'=>$_GPC['id']));
        if($res){
             message('编辑成功！', $this->createWebUrl('videocardlist'), 'success');
        }else{
             message('编辑失败！','','error');
        }
    }
}
include $this->template('web/addvideocard');